package cn.sitedev;

/**
 * 测试类
 */
public class OpenCloseTest {
    public static void main(String[] args) {
        ICourse course = new JavaCourse(1, "Java架构", 11800);
        System.out.println("课程id: " + course.getId() + "\n课程标题: " + course.getName() + "\n售价: " + course.getPrice());
        System.out.println("==============================");
        course = new JavaDiscountCourse(course.getId(), course.getName(), course.getPrice());
        System.out.println("课程id: " + course.getId() + "\n课程标题: " + course.getName() + "\n售价: " + course.getPrice() + "\n原价: " + ((JavaDiscountCourse) course).getDiscountPrice());
    }
}
